<?php
global $sys;
?>
<!-- Sidebar -->
<div class="aside">
    <h2>Profile</h2>
    
    <div class="aside-box box">
<?php if ($_SESSION['user']['id']!="") { ?>
	<div class="f-left"><strong>Hi <a href="<?php echo HOST_URL; ?>profile/register"><?php echo $_SESSION['user']['fname']." ".$_SESSION['user']['lname']; ?></a> !</strong></div><br/><br/>
    <div class="f-right"><a href="<?php echo HOST_URL; ?>profile/logout"><img src="<?php echo THEME_URL; ?>design/btn-logout.gif" /></a></div>
<?php } else { ?>
<form action="<?php echo HOST_URL; ?>profile/login" method="post">
<?php $sys->formToken(); ?>
    <div class="f-left"><strong>e-mail</strong></div><br/>
    <div class="f-left"><input type="text" size="30" name="user" class="input" style="width:170px;" /></div><br/><br/>
    <div class="f-left"><strong>password</strong></div><br/>
    <div class="f-left"><input type="password" size="30" name="pass" class="input" style="width:170px;" /></div>
    <div class="f-right"><input type="image" src="<?php echo THEME_URL; ?>design/btn-ok.gif" value="OK" /></div><br/><br/>
    <div class="f-left"><a href="<?php echo HOST_URL; ?>profile/register">register</a></div><br/>
    <div class="f-left">


    <p><fb:login-button autologoutlink="true"></fb:login-button></p>

    <div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {
        FB.init({appId: '158317054221565', status: true, cookie: true,
                 xfbml: true});
      };
      (function() {
        var e = document.createElement('script');
        e.type = 'text/javascript';
        e.src = document.location.protocol +
          '//connect.facebook.net/en_US/all.js';
        e.async = true;
        document.getElementById('fb-root').appendChild(e);
      }());
    </script>


    </div>
</form>
<?php } ?>
    </div> <!-- /aside-box -->

</div> <!-- /aside -->